package cn.edu.lingnan.dao;

import cn.edu.lingnan.pojo.Score;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface ScoreMapper {
    @Insert("insert into school1.score values (#{sid},#{cid},#{grade},#{scflag})")
    Integer insert(Score score);

    @Update("update school1.score set grade=#{grade},scflag=#{scflag} where sid=#{sid} and cid=#{cid}")
    Integer update(Score score);

    @Select("select * from school1.score where sid=#{sid}")
    List<Score> getById(String sid);

    @Delete("delete from school1.score where sid=#{sid} and cid=#{cid} ")
    Integer deleteById(String sid,String cid);

    @Delete("delete from school1.score where sid=#{sid}")
    Integer deleteBySid(String sid);
}
